#include <iostream>
using namespace std;
int main()
{
	int num = 0;
	cin >> num;
	bool flag = false;
	flag = (num % 4 ==0 && num % 100 !=0)||(num % 400 == 0);
	if(flag){
		cout << "1" << endl;
	} else{
		cout << "0" << endl;
	}
	
	return 0;
} 
